Skip to content

docs(skills): config-first idiomatic usage in CLI skill examples#355

Merged
clavery merged 2 commits intomainfrom
feature/skill-refinement-flags
Apr 20, 2026
Merged

docs(skills): config-first idiomatic usage in CLI skill examples#355
clavery merged 2 commits intomainfrom
feature/skill-refinement-flags

Conversation

@clavery
Copy link
Copy Markdown
Collaborator

@clavery clavery commented Apr 18, 2026

Summary

  • Refactor b2c CLI skill examples so they assume configured values (tenantId, shortCode, slasClientId, clientId, server) resolve from dw.json / SFCC_* env vars, with flags shown only as overrides.
  • Addresses a recurring friction point where coding agents, following the skill examples, prompt users for values already present in their configuration (e.g. --client-id, --client-secret, --tenant-id, --short-code).
  • Added a short "Configuration" preamble to each refactored skill pointing readers at the b2c-config skill for the precedence model. The CLI already emits actionable errors when a required value is missing, so skills no longer need to pre-emptively demand flags.

Affected skills

  • b2c-scapi-schemas — stripped --tenant-id zzxy_prd from every example; kept one override example; softened "required" language.
  • b2c-scapi-custom — same treatment as scapi-schemas.
  • b2c-slas — stripped --tenant-id; collapsed duplicated token examples; moved --short-code / --slas-client-* overrides into a config overrides section.
  • b2c-ecdn (+ references/SECURITY.md, references/ADVANCED.md) — stripped --tenant-id throughout.
  • b2c-cip — rewrote Requirements as config-first; removed --tenant-id abcd_prd from examples.
  • b2c-users-roles — minimal b2c bm roles list first; --server shown as override.

Audited, no changes needed

  • b2c-am — credentials framed correctly in the Authentication section (CI/CD override path).
  • b2c-sandbox--realm is genuinely required (no config fallback).
  • b2c-sites, b2c-docs, b2c-code, b2c-config — already idiomatic.

Changeset

Added .changeset/skill-config-first-examples.md (patch @salesforce/b2c-cli).

Test plan

  • Manual review: each refactored skill's first example in a section should be runnable against a configured dw.json without extra flags.
  • Spot-run one minimal command per affected skill against a configured instance:
    • b2c scapi schemas list
    • b2c scapi custom status
    • b2c slas client list
    • b2c ecdn zones list
    • b2c cip tables
  • Confirm that when a required value is missing from config, the CLI error message points at the flag, env var, and config key (so skills don't need to repeat that guidance).
  • Docs build still passes (no skill path references changed).

clavery added 2 commits April 18, 2026 12:37
Update b2c CLI skills so command examples assume configured values
(tenantId, shortCode, slasClientId, clientId, server) resolve from
dw.json / SFCC_* env vars, with flags shown only as overrides. This
prevents coding agents from prompting users for values that are
already present in their configuration.

Affected skills: scapi-schemas, scapi-custom, slas, ecdn (+ references),
cip, users-roles.
When running interactively, detect already-installed skills and prompt
the user to overwrite them rather than requiring the --update flag
up front. Non-interactive behavior (--force, --update, --json)
is preserved.

Widen isSkillInstalled options to include the optional directory
override so the target-path check matches the installer's resolution
when --directory is provided.
@clavery clavery marked this pull request as ready for review April 20, 2026 17:40
@clavery clavery merged commit 3dedc05 into main Apr 20, 2026
4 checks passed
@clavery clavery deleted the feature/skill-refinement-flags branch April 20, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant